'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);


  router.get('/alipay', controller.pay.alipay);
  //登录
  router.post('/login', controller.login.login);
  //注册
  router.post('/regis', controller.login.regis)
  //模拟数据
  router.get('/mock', controller.home.mock)
  //渲染数据
  router.post('/getlist', controller.home.getList)
  //筛选
  router.post('/area', controller.home.area)
  //筛选
  router.post('/area1', controller.home.area1)
  //筛选
  router.post('/area2', controller.home.area2)
  //搜索
  router.post('/search', controller.home.search)
  //搜索1
  router.post('/search2', controller.home.search2)
  //搜索2
  router.post('/search3', controller.home.search3)
  //搜素3
  router.post('/search4', controller.home.search4)
  //详情
  router.post('/detail', controller.home.detail)
  //加入购物车
  router.put('/add', controller.home.add)
  //渲染购物车
  router.post('/addlist', controller.home.addlist)
  //搜索
  router.post('/search1', controller.home.search1)
  //删除
  router.delete('/delete', controller.home.delete)
  //全选
  router.post('/carIs', controller.home.carIs)
  //加加减减
  router.post('/carItem', controller.home.carItem)
  //获取数据
  router.post('/drug', controller.home.drug)
  //添加
  router.post('/druglist', controller.home.druglist)
  //加入订单
  router.put('/order', controller.home.order)
  //渲染全部订单
  router.post('/orderlist', controller.home.orderlist)
  //删除订单
  router.delete('/del', controller.home.del)
  //添加地址
  router.post('/address', controller.home.address)
  //渲染添加后的地址
  router.post('/addresslist', controller.home.addresslist)
  //删除地址
  router.delete('/delcity', controller.home.delcity)
  router.delete('/drugdel', controller.home.deletedrug)
  //添加档案
  router.post('/one', controller.home.one)
  //渲染档案
  router.post('/onelist', controller.home.onelist)
};
